home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Demos
/
A.D. Software
/
OOFILE
/
PhoneControl OOFILE sample
/
Source
/
CCompletedImport.cp
< prev
next >
Wrap
Text File
|
1995-12-13
|
3KB
|
163 lines
// CCompletedImport.cp -- dialog methods
// Created 01/01/95 12:01 PM by AppMaker
#include "CCompletedImport.h"
#include <UReanimator.h>
#include <LStream.h>
#include <LStdControl.h>
#include <LCaption.h>
#include <PP_Messages.h>
#define PPob_CompletedImportID 203
#define RidL_CompletedImportID 203
//----------
CCompletedImport*
CCompletedImport::CreateCompletedImport(
LCommander *inSuperCommander)
{
return ((CCompletedImport *)LWindow::CreateWindow(PPob_CompletedImportID, inSuperCommander));
}
//----------
// This is the function you register with URegistrar to create a
// CCompletedImport from a resource
CCompletedImport*
CCompletedImport::CreateCompletedImportStream(
LStream *inStream)
{
return (new CCompletedImport(inStream));
}
//----------
// The default constructor does nothing.
CCompletedImport::CCompletedImport()
{
}
//----------
// The read-from-stream constructor just reads a dialog object.
CCompletedImport::CCompletedImport(
LStream *inStream)
: LDialogBox(inStream)
{
}
//----------
// The destructor does nothing.
CCompletedImport::~CCompletedImport()
{
}
//----------
// This member function gets called once the containment hierarchy that contains
// this pane has been built. It gives us a chance to get data members for
// interesting subviews, and to do other operations now that our subviews exist.
void
CCompletedImport::FinishCreateSelf()
{
LDialogBox::FinishCreateSelf();
mOKButton = (LStdButton *)FindPaneByID('OK ');
mNumImported = (LCaption *)FindPaneByID('NImp'); // added so we can alter later
UReanimator::LinkListenerToControls(this, this, RidL_CompletedImportID);
// the purpose is to "connect" self to whatever controls
// that we want to "listen" to
// any additional initialization for your dialog:
}
//----------
void
CCompletedImport::ListenToMessage(
MessageT inMessage,
void *ioParam)
{
switch (inMessage) {
case msg_OK:
GetSuperCommander()->ProcessCommand(cmd_CompletedImport, this);
break;
case msg_Cancel:
DoClose();
break;
default:
break;
}
}
//----------
Boolean
CCompletedImport::ObeyCommand(
CommandT inCommand,
void *ioParam)
{
Boolean cmdHandled = true;
switch (inCommand) {
// +++ Add cases here for the commands you handle
// Remember to add same cases to FindCommandStatus below
// to enable/disable the commands
default:
cmdHandled = LDialogBox::ObeyCommand(inCommand, ioParam);
break;
}
return cmdHandled;
}
//----------
void
CCompletedImport::FindCommandStatus(
CommandT inCommand,
Boolean &outEnabled,
Boolean &outUsesMark,
Char16 &outMark,
Str255 outName)
{
outUsesMark = false;
switch (inCommand) {
// +++ Add cases here for the commands you handle
default:
LDialogBox::FindCommandStatus(inCommand, outEnabled,
outUsesMark, outMark, outName);
break;
}
}
//----------
Boolean
CCompletedImport::FocusDraw()
{
Boolean focused = LView::FocusDraw();
if (focused) {
AuxWinHandle awHndl;
CTabHandle awCTable;
ColorSpec contentSpec;
GetAuxWin(GetMacPort(), &awHndl);
awCTable = (**awHndl).awCTable;
contentSpec = (**awCTable).ctTable [wContentColor]; // should search vs. index
::RGBBackColor(&contentSpec.rgb);
}
return focused;
}
void
CCompletedImport::SetImported(unsigned long inCount)
{
mNumImported->SetValue(inCount);
}